package com.yutianran.springBoot;

import java.io.File;
import java.io.IOException;

public class CmdMain {

    public static final String dot = "C:\\Program Files (x86)\\Graphviz2.38\\bin\\dot.exe";
    public static final String srcDir = "C:\\Users\\DELL\\code\\springBoot\\src\\main\\java\\com\\yutianran\\springBoot\\dot";
    public static final String destDir = "C:\\Users\\DELL\\code\\springBoot\\src\\main\\resources\\dot";
    public static final String type = "png";

    public static void main(String[] args) throws IOException {
        Runtime rt = Runtime.getRuntime();
        String name = "activity";
        String src = srcDir + File.separator + name + ".dot";
        String dest = destDir + File.separator + name + ".png";
        String[] cmd = {dot, "-T" + type, src, "-o", dest};
        Process p = rt.exec(cmd);
    }
}
